package fun.coding.tree.bst;

import java.util.ArrayList;
import java.util.Queue;

public interface BinarySearchTree {

	void insert(BSTNode node, int value);
	
	void delete(int value);
	
	int find(BSTNode node, int value);
	
	void inOrderTraversal(BSTNode node);
    ArrayList<Integer> inOrderTraversalArray(BSTNode node);
	
	void preOrderTraversal(BSTNode node);
	
	void postOrderTraversal(BSTNode node);
	
	void levelOrderTraversal(BSTNode node);
	void levelOrderTraversalList(BSTNode node);
	void levelOrderPrintOneLevel(BSTNode node, int level);
	
	Queue<BSTNode> getQ();
	
	void findKthLargestNode(BSTNode head, int k);
	
	// determin if two trees are isomorphic
	boolean isIsomorphic(BSTNode head1, BSTNode head2);
	
	void printOutHuffmanCoding(BSTNode head, int k);
	
	int getTreeHeight(BSTNode head);
	
	boolean isBalanced(BSTNode head);
	
	void flatten(BSTNode head);
	
	boolean isBST(BSTNode head);
	
	boolean isBSTBetter(BSTNode head, int max, int min);
	
	boolean isBSTInorder(BSTNode head);
	
	public BSTNode buildBinaryTreeFromInOrderPreOrder(int[] inOrder, int[] preOrder, 
	        int inOrderIndex, int preOrderIndex, int length);	
	
	public BSTNode cloneBST(BSTNode head);
	
	public BSTNode mirrorBST(BSTNode head);
	
	public int countBSTNode(BSTNode head);
	
	public int countBSTLeaf(BSTNode head);
	
	public int maxPathSum(BSTNode head);
}
